package Properties_;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;
public class properties02_ {
    public static void main(String[] args) throws IOException {
        Properties properties=new Properties();
        //加载指定配置文件
        properties.load(new FileReader("src\\scratch.txt"));
        //把k——v显示控制台
        properties.list(System.out);
        String user=properties.getProperty("user");
        String pwd=properties.getProperty("pwd");
        System.out.println("用户名是"+user);
        System.out.println("密码是"+pwd);
    }
}
